/*
 * @Author: wxj
 * @Description:
 */
/**
 * @param {number} x
 * @return {boolean}
 */
// var isPalindrome = function (x) {
//   let str = x + "";
//   if (str.split("").reverse().join("") == str) {
//     return true;
//   }
//   return false;
// };

var isPalindrome = function (x) {
  x = x + "";
  let isTrues = true;
  let length1 = x.length;
  let length = Math.floor(x.length) / 2;
  for (let i = 0; i < length; i++) {
    if (x.charAt(i) !== x.charAt(length1 - i - 1)) {
      isTrues = false;
      break;
    }
  }

  return isTrues;
};

console.log(isPalindrome(121));
